Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Intern types #589

Closed
wants to merge 2 commits into from
Closed

Intern types #589

wants to merge 2 commits into from

Conversation

Vexu
Copy link
Owner

@Vexu Vexu commented Nov 28, 2023

Some design ideas for improving working with types:

  • Parser.Result can store both a Type and Type.Interner.Key
  • get by default recurses wrapper types
  • move named types out of Compilation
  • ...more?

@Vexu
Copy link
Owner Author

Vexu commented Nov 28, 2023

On further thought using an interner here doesn't make much sense (can't do fast equality check; only identity, simple types are as big as the Ref, no plans of incremental compilation). I'm going to instead look into using tagged pointers which also enable variable size and different storage/unwrapped representation.

@Vexu Vexu closed this Nov 28, 2023
@ehaas
Copy link
Collaborator

ehaas commented Nov 28, 2023

I'm not very familiar with the clang codebase but I was curious how they handle types and it sounds like they might do something similar (with tagged pointers) https://github.com/llvm/llvm-project/blob/ce731770f869e8e61afa2dccb772e8367105a1a6/clang/include/clang/AST/Type.h#L740

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants